package com.hsmpay.mobile.dao.organization;

import com.hsmpay.common.dao.BaseDao;

import java.io.Serializable;
import java.sql.SQLException;

/**
 * 机构预存款 Dao接口
 *
 * @param <Entity>
 * @param <Query>
 * @author 颜铃璋
 *         建立时间：2014-3-21
 */
public interface OrgPreDepositDao<Entity extends Serializable, Query extends Object> extends BaseDao<Entity, Query> {
    /**
     * 查询 预贷款
     *
     * @param terminalTypeId
     * @param roleId
     * @return
     * @throws SQLException
     */
    public double getPreDepositByOrgId(Long terminalTypeId, Long roleId) throws SQLException;

    /**
     * 添加 或 减少 预存款
     *
     * @param terminalTypeId
     * @param roleId
     * @param preDeposit
     * @param orderNum
     * @param userId
     * @return
     * @throws SQLException
     */
    public int updateCashMoneyPreDeposit(Long terminalTypeId, Long roleId, Double preDeposit, String orderNum, Long userId) throws SQLException;

}
